package org.gpp.proj1.robot.action.step;

import java.util.HashMap;
import java.util.LinkedList;

import junit.framework.TestCase;

import org.easymock.EasyMock;
import org.gpp.proj1.bone.Bone;
import org.gpp.proj1.robot.Robot;
import org.gpp.proj1.robot.modifier.Modifier;
import org.gpp.proj1.robot.part.EquippedPart;
import org.gpp.proj1.robot.part.PartType;
import org.gpp.proj1.robot.part.emissor.Emissor;

public class ChangeAnimationActionStepTest extends TestCase {
	public void testAction() {
		Robot robotMock = EasyMock.createMock( Robot.class );
		EquippedPart part = new EquippedPart( "testPart",
				PartType.HEAD,
				100,
				new HashMap<String, Integer>(),
				new LinkedList<Modifier>(),
				new HashMap<String, String>(),
				new HashMap<String, String>(),
				new LinkedList<Emissor>(),
				new LinkedList<String>(),
				robotMock,
				new HashMap<String, Bone>() );		
		
		ChangeAnimationActionStep step = new ChangeAnimationActionStep("walking");
						
		EasyMock.reset( robotMock );
		robotMock.setAnimation( EasyMock.eq( "walking" ) ); EasyMock.expectLastCall().times( 1 ) ;
		EasyMock.replay( robotMock );
		
		step.execute( part, null );
		
		EasyMock.verify( robotMock );
	}
}
